package com.cn.kabalifeuser.ui.my.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.ui.my.bean.NewMsgListBean;

import java.util.List;

/**
 * Created by 晓林 on 2020/9/4.
 * function:
 */
public class NewMsgListAdapter extends BaseQuickAdapter<NewMsgListBean.ResultBean.DataBean, BaseViewHolder> {
    int type;

    public NewMsgListAdapter(int layoutResId, @Nullable List<NewMsgListBean.ResultBean.DataBean> data, int type) {
        super(layoutResId, data);
        this.type = type;
    }

    @Override
    protected void convert(BaseViewHolder helper, final NewMsgListBean.ResultBean.DataBean item) {
//        GlideUtil.ImageLoad(this.mContext, item.getList_img(), helper.getView(R.id.list_img));
        helper.setText(R.id.tv_content, type == 2 ? "" : item.getContent())
                .setText(R.id.tv_created_at, item.getCreated_at())
                .setText(R.id.tv_title, item.getTitle())

        ;
        if (item.getIs_read() == 1)
            helper.setGone(R.id.tv_msg, false);
        else helper.setGone(R.id.tv_msg, true);
    }
}

